<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</meta>
<title>F.validator演示</title>
<style type="text/css">
html, body{font-size:12px; color:#333; font-family:"Courier New", Courier, monospace;}
.tb{ border-collapse:collapse; border:1px solid #ccc; }
.tb td{ border:1px solid #ccc; }
.tb .txt{ border:1px solid #A5AEB6; padding:2px; width:196px; height:18px;}
.tb s{text-decoration:none; color:red; margin-right:5px;}
.tb i{font-style:normal; color:red; background:url(/img/error.png) no-repeat; padding-left:20px; display:none;}
.tb u{text-decoration:none;color:gray; background:url(/img/onload.gif) no-repeat; padding-left:20px; display:none;}
.tb b{font-weight:normal; color:green; background:url(/img/right.png) no-repeat; padding-left:20px; display:none;}
</style>
<script type="text/javascript" src="../../1st.js"></script>
</head>
<body>
<form class="First_Form" action="data/validator.php?chk=form" ajax="callback">
	<table width="600" border="0" cellspacing="0" cellpadding="6" align="center" class="tb">
		<tr>
			<td width="80"><s>*</s>用户名：</td>
			<td>
				<input class="txt" type="text" name="username" />
				<i required="1">请输入用户名</i>
				<i minlen="2" maxlen="16" re="uid">用户名由2-16个英文字母、数字、下划线组成。</i>
				<u url="/fw4/data/validator.php">正在验证用户名...</u>
				<b>用户名可以注册</b>				
				<i>用户名已经存在</i>
			</td>
		</tr>
		<tr>
			<td><s>*</s>密码：</td>
			<td>
				<input class="txt" type="password" name="password" />
				<i required="1">请输入密码</i>				
				<i minlen="6" maxlen="20" pattern="^w+$">密码由6-20个英文字母、数字、下划线组成。</i>
				<b>密码格式正确</b>
			</td>
		</tr>
		<tr>
			<td><s>*</s>确认密码：</td>
			<td>
				<input class="txt" type="password" id="password2" />
				<i required="1">请再输入一次密码！</i>				
				<i pwd="password">两次输入的密码不一致</i>
				<b>两次输入的密码一致</b>
			</td>
		</tr>
		<tr>
			<td><s>*</s>邮箱：</td>
			<td>
				<input class="txt" type="text" name="email" />
				<i required="1">请输入邮箱地址</i>
				<i re="email">邮箱格式有误</i>
				<b>邮箱格式正确</b>
			</td>
		</tr>
		<tr>
			<td>手机：</td>
			<td>
				<input class="txt" type="text" name="mobile" />
				<i empty="1" re="mobile">手机格式有误</i>
				<b>手机格式正确</b>
			</td>
		</tr>
		<tr>
			<td>网站：</td>
			<td>
				<input class="txt" type="text" name="site" />
				<i empty="1" re="url">网址格式有误</i>
				<b>网址格式正确</b>
			</td>
		</tr>
		<tr>
			<td><s>*</s>性别：</td>
			<td>
				<input type="radio" name="sex" />男
				<input type="radio" name="sex" />女
				<i required="1">请选择性别</i>
				<b>通过信息验证</b>
			</td>
		</tr>
		<tr>
			<td><s>*</s>城市：</td>
			<td>
				<select name="city">
					<option>--请选择城市--</option>
					<option>深圳</option>
				</select>
				<i empty="1" re="mobile">请选择城市</i>
				<b>通过信息验证</b>
			</td>
		</tr>
		<tr>
			<td><s>*</s>购物网：</td>
			<td>
				<input type="checkbox" name="eshop" /> 有药网
				<input type="checkbox" name="eshop" /> 易保网
				<i empty="1" re="url">请选择购物网</i>
				<b>通过信息验证</b>
			</td>
		</tr>		
		<tr>
			<td></td>
			<td>
				<input type="submit" value=" 提交 " style="height:24px; width:100px" />
			</td>
		</tr>
	</table>
</form>

<script type="text/javascript">
function callback(msg){
	alert(msg);
}
F.validator(document.forms[0]);
</script>
</body>
</html>